package 进制;

import java.util.Scanner;

public class hammingWeight {
    public static int hammingWeight(int n) {
        int ans=0;
        while (n!=0){
            if((n&1)==1){
                ++ans;
            }
//            无符号右移，高位都补0
            n=n>>>1;
        }
        return ans;
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            int n=scanner.nextInt();
            System.out.println(hammingWeight(n));
        }
    }
}
